﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GuiLibrary.Components;
using Imaginarium.team;
using Imaginarium.battleSistem;
using Microsoft.Xna.Framework.Graphics;
using GuiLibrary.layouts;
using Microsoft.Xna.Framework;
using GameEngine.Scenes;
using Microsoft.Xna.Framework.Input;
using GuiLibrary;

namespace Imaginarium.gui
{
    public class GameOverGui: Gui
    {
        #region Constructors
        public GameOverGui() :
            base() { }
        #endregion

        public override void LoadContent()
        {
           
            #region CreateGuiComponents
            basePanel = new Panel(position, GUIParameters.backgroundGameOverGUI());
            SpriteFont font = Imaginarium.ImaginariumGame.getInstance().Content.Load<SpriteFont>(CodeParameters.gameOverFont);
            basePanel.layout = new BorderLayout(basePanel, GUIParameters.marginsGameOverGUI, null, null, null);
            ((BorderLayout)basePanel.layout).addComponent(new Label(basePanel, new Text(font, "              You have died. \nPress Enter or Escape to finish.", Color.White, GameEngine.animations.OriginType.CENTER)), BorderLayout.BorderLocation.CENTER);
            basePanel.refresh();
            SceneManager.getInstance().enabledInput = true;
            #endregion
        }
        public override void onSelectedElement(Element e)
        {
            //No selectable elements
        }
        public override void handleInput() //General input (independant of the components)
        {
            InputManager im = InputManager.getInstance();

            if (im.isNewKeyPressed(Keys.Enter) || im.isNewKeyPressed(Keys.Escape))
                ImaginariumGame.getInstance().Exit();
            base.handleInput();
        }
        public override void update(GameTime gameTime) //Substract exp to the gained amount and add it to the players' exp
        {
            base.update(gameTime);
        }
    }
}
